<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!doctype html>
<html class="no-js">
<head>
<title>确认订单</title>
<%@ include file="../../mobilehead_inc.jsp"%>
<script>
	//返回上一页	
	function back() {
		history.back()
	}

	function checkSubmit() {
		var url = "${ctx}/mobile/saveNewOrder";
		var vals = $('#myform').serialize();
		//console.log(vals);
		$.ajax({
			async : false,
			type : "POST",
			url : url,
			data : vals,
			cache : false,
			dataType : 'json',
			success : function(data) {
				if (data.success == 0) {
					window.location.href = "${ctx }/mobile/successOrder?orderId="+data.rows;
					clearCookies();
				} else {
					alert("下单失败！请再试一次");
				}
			}
		});
	}
</script>
<style>
.am-direction-nav {
	display: none;
}

#submitButton {
	float: right;
	list-style-type: none;
	margin-top: 5px
}

#myform {
	margin-left: 10px;
	margin-right: 10px;
}

#myform table tbody tr td input {
	font-size: 15px
}

#myform table tbody tr td {
	color: gray
}

#inTable tr td {
	color: gray
}

table.altrowstable {
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	color: #333333;
	border-width: 1px;
	border-color: #a9c6c9;
	border-collapse: collapse;
}

table.altrowstable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #FFFFFF;
}

table.altrowstable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #FFFFFF;
}

.oddrowcolor {
	background-color: #F0F0F0;
}

.evenrowcolor {
	background-color: #A2B5CD;
}
</style>
</head>
<body style="background:#FFFFCC">
	<!-- 上部 -->
	<header data-am-widget="header"
		class="am-header am-header-default joan-head" style="background:#9999FF">
		<div class="am-header-left am-header-nav">
			<a href="#" onclick="back();" target="_self" class=""> <i
				class="am-icon-mail-reply"></i>
			</a>
		</div>

		<h1 class="am-header-title">
			<a href="#title-link" class=""> 确认订单 </a>
		</h1>

		<div class="am-header-right am-header-nav">
			<a href="${ctx }/" target="_self" class=""> <i
				class="am-header-icon am-icon-home"></i>
			</a>
		</div>
	</header>

	

		<table id="mainDiv" border="0" cellpadding="0" cellspacing="10"
			class="altrowstable" id="alternatecolor">
			<tr>
				<td width="25%"><table width="26%" border="0" cellpadding="0"
						cellspacing="0" class="l-r-t-b-1pxline">
						<tr>
							<td><img src="${photo }" width="100" height="100"></td>
						</tr>
					</table></td>
				<td width="75%">
					<table id="inTable" width="100%" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td>商品名：</td>
							<td>${name }</td>
						</tr>
						<tr>
							<td>单价：</td>
							<td>${price }</td>
						</tr>
					</table>
			</td>
			</tr>
		</table>
		<form class="am-form" id="myform" method="POST" name="myform">
		<table class="am-table">
			<tbody>
			<%-- 	<tr>
					<td>联系人：</td>
					<td><textfield name="userName"
						style="background: transparent; border: 0" 
						size=10 placeholder="请输入姓名"/>${userName }</textfield></td>
				</tr> --%>
				
				<tr>
					<td>联系人：</td>
					<td><textarea name="userName" cols="3" maxlength="100"
							style="background: transparent; border: 0"
							placeholder="请输入姓名"></textarea></td>
				</tr>
				<tr>
					<td>手机号码：</td>
					<td><textarea name="phone" cols="3" maxlength="100"
							style="background: transparent; border: 0"
							placeholder="请输入手机号码"></textarea></td>
				</tr>
				<%-- <tr>
					<td>联系电话：</td>
					<td><textfield name="phone"
						style="background: transparent; border: 0"
						value="${phone }"  size=10 placeholder="请输入手机号码" />{phone }</textfield></td>
				</tr> --%>
				<%-- <tr>
					<td>昵称：</td>
					<td><input name="nickName"
						style="background: transparent; border: 0" readonly="readonly"
						value="${nickName }" /></td>
				</tr> --%>
				
				<tr>
					<td>数量：</td>
					<td><input name="orderNumber"
						style="background: transparent; border: 0" readonly="readonly"
						value="${count }" /></td>
				</tr>
				<tr>
					<td>应付金额：</td>
					<td><input name="payPrice"
						style="background: transparent; border: 0;color: orange" readonly="readonly"
						value="${total_price }" /></td>
				</tr>
				<tr>
					<td>收货地址：</td>
					<td><textarea name="address" cols="3" maxlength="100"
						style="background: transparent; border: 0" placeholder="请输入收货地址" >${address }</textarea></td>
				</tr>
				<tr>
					<td>留言：</td>
					<td><textarea name="tag" cols="3" maxlength="100"
							style="background: transparent; border: 0"
							placeholder="留言信息"></textarea></td>
				</tr>
			</tbody>
		</table>


		<input type="hidden" value="${depId }" name="sysDepartment.depId" />
		<input type="hidden" value="${comId }" name="commodityInfo.commodityId" />
		<input type="hidden" value="${custId }" name="syscustomer.custId" />
		<p>
		<div class="am-radio">
			<label> <input type="radio" name="payWay" value="2"
				checked> <img src="/mobile/images/zsq.png" width="30"
				height="30"> <span
				style="font: normal; font-size: 15px; color: gray;">货到付款</span>
			</label>
		</div>

		<div class="am-radio">
			<label> <input type="radio" name="payWay"
				disabled="disabled" value="1"><img
				src="/mobile/images/weixin.jpg" width="30" height="30"> <span
				style="font: normal; font-size: 15px; color: gray;">微信支付(暂未开通)</span>
			</label>
		</div>
         <div class="am-radio">
			<label> <input type="radio" name="payWay"
				disabled="disabled" value="1"><img
				src="/mobile/images/zhifubao.jpg" width="30" height="30"> <span
				style="font: normal; font-size: 15px; color: gray;">支付宝支付(暂未开通)</span>
			</label>
		</div>
		<!--底部 -->
		<!--  ${bottom}-->
		<div data-am-widget="navbar"
			class="am-navbar  am-navbar-default gm-foot" id="">
			<ul class="am-navbar-nav am-cf am-avg-sm-4">
				<li>

					<div class="shop-cart">
						<span style="font: normal; font-size: 15px; color: gray;">合计：￥</span>
						<span style="font: normal; font-size: 30px; color: orange;">${total_price }</span>
						<button type="button" id="submitButton" onclick="checkSubmit();"
							class="am-btn am-btn-warning am-fr ">确认订单</button>

					</div>
				</li>
			</ul>
		</div>

	</form>
</body>
</html>
